import React, { Component } from 'react'
import { withRouter } from 'react-router-dom'
import { Menu } from 'antd'

class MyMenu extends Component {

	items = [
		{ label: "Home", key: '/home' },
		{ label: "Count", key: '/count' },
		{ label: "Todo", key: '/todo' },
	]

	onClick = e => {
		console.log('click ', e.key);
		console.log(this.props)
		this.props.history.push(e.key)
	}
	render() {
		return (
			<div className="menu">
				<Menu
					onClick={this.onClick}
					style={{ width: 150 }}
					mode="inline"
					items={this.items}
				/>
			</div>
		)
	}
}

export default withRouter(MyMenu)
